<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>审批历史明细</title>
    <#include "/pubHeadStyle.html">
</head>
<body>
<div id="processCopyToDiv" class="ccpui-tablesize opinion">
    <!--数据列表-->
    <table class="layui-table"  lay-filter="processCopyTo" id="processCopyTo" style="text-align: center;"></table>
</div>
<div class="layui-btn-container" style="width:100%;position: absolute;bottom: 20px;text-align: center;">
    <button class="layui-btn layui-btn-danger" id="close" style="margin: 0!important;">关闭</button>
</div>
<script>
    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index','setter','table','form','util'], function(){
        var setter = layui.setter;
        var table = layui.table;
        var util = layui.util;
        var $ = layui.$;
        $(".opinion").height($(".layui-layout-body").height()-100);
        $(".opinion").css("overflow","auto");
        if ($(".layui-tab-title").length>0){
            $("#close").hide();
        }
        table.render({
            elem: '#processCopyTo'
            ,title:"抄送人"
            ,method:"post"
            ,url:serverPath.workflowPath+setter.workflowLinkPath+"processCopyTo/getByInstId?runId=${runId}"
            ,cols: [[
                {field:'ccUName', title: '接收人', align: 'center'}
                // ,{field:'posName', title: '岗位', align: 'center'}
                ,{field:'orgName', title: '组织', align: 'center'}
                ,{field:'isRead', title: '是否已读', align: 'center',templet:function (d) {
                    if(d.isRead==0) {
                        return "<span style='color:red'>未读</span>";
                    }else if(d.isRead==1){
                        return "<span style='color:green'>已读</span>";
                    }else{
                        return "";
                    }
                }}
                ,{field:'ccTime', title: '抄送时间', align: 'center', templet:function (d) {
                        if(d.ccTime== "undefined" || d.ccTime==""){
                            return "";
                        }
                        return util.toDateString(d.ccTime, "yyyy-MM-dd HH:mm:ss");
                    }}
                ,{field:'cpType', title: '类型', align: 'center', templet:function (d) {
                        if(d.cpType==1) {
                            return "<span style='color:green'>抄送</span>";
                        }else if(d.cpType==2){
                            return "<span style='color:brown'>转发</span>";
                        }else{
                            return "";
                        }
                    }}
            ]]
        });
        //关闭按钮
        $('#close').click(function () {
            var index=parent.layer.getFrameIndex(window.name);
            if(index) {
                parent.layer.close(index);
            }else {
                //关闭流程明细之抄送人的网页
                window.parent.opener = null;
                window.parent.open('', '_self');
                window.parent.close();
            }
        });
    });


</script>
</body>
</html>